
package com.joysuch.wwyt.datadump.biz.query;

import cn.zlg.common.datadump.condition.QueryCondtionDef;
import cn.zlg.common.datadump.condition.QueryFieldCondition;
import cn.zlg.common.datadump.condition.SortFieldDef;
import com.joysuch.wwyt.bp.entity.contractor.dsl.QBpContractor;
import com.joysuch.wwyt.bp.entity.contractor.dsl.QBpContractorStaff;
import com.querydsl.core.types.Order;

public class BpContractorStaffDumpQueryBean implements QueryCondtionDef {

    @Override
    public QueryFieldCondition[] getAllConditionDef() {
        return new QueryFieldCondition[] {
                new QueryFieldCondition("ids", QBpContractorStaff.bpContractorStaff,
                        QBpContractorStaff.bpContractorStaff.id, QBpContractorStaff.bpContractorStaff.id, "in"),
                // 姓名
                new QueryFieldCondition("name", QBpContractorStaff.bpContractorStaff,
                        QBpContractorStaff.bpContractorStaff.name, QBpContractorStaff.bpContractorStaff.id, "contains"),
                // 定位卡号
                new QueryFieldCondition("sn", QBpContractorStaff.bpContractorStaff,
                        QBpContractorStaff.bpContractorStaff.sn, QBpContractorStaff.bpContractorStaff.id, "contains"),

                // 承包商
                new QueryFieldCondition("contractorId", QBpContractorStaff.bpContractorStaff,
                        QBpContractorStaff.bpContractorStaff.contractorId, QBpContractorStaff.bpContractorStaff.id,
                        "eq"),
                // 状态
                new QueryFieldCondition("state", QBpContractorStaff.bpContractorStaff,
                        QBpContractorStaff.bpContractorStaff.state, QBpContractorStaff.bpContractorStaff.id,
                        "eq"),
                // 承包商类型
                new QueryFieldCondition("contractorType", QBpContractor.bpContractor,
                        QBpContractor.bpContractor.contractorType, QBpContractor.bpContractor.id,
                        QBpContractorStaff.bpContractorStaff.contractorId, "eq"),

        };
    }

    @Override
    public SortFieldDef[] getAllSortFieldDef() {
        return new SortFieldDef[] { new SortFieldDef(QBpContractorStaff.bpContractorStaff.name, "name", Order.ASC) };
    }
}
